<?php
class Core_Data_Privileges {
	
	/**
	 * database handler
	 * 
	 * @var $database
	 */
	private $database;
	
	/**
	 * constructor
	 */
	public function __construct(){
		
		$this->database = new Core_Driver_MysqlImproved();
		
	}
	
	/**
	 * return privileges array
	 * 
	 * @return multitype:string $privilegesData
	 */
	public function getPrivilegesData(){
		
		$this->database->connect();
		
		$this->database->prepare(
			"
				SELECT
				privileges.privilege_name,
				privileges.privilege_type
				FROM
				privileges
				ORDER
				BY
				privileges.privilege_type
				ASC
				;
				"
		);
		
		$this->data->query();
		
		$privilegesData = array();
		
		while($data = $this->database->fetch('array')){
			
			$privilegesData[$data['privilege_type']] = "( " .$data['privilege_type'] . " ) " . $data['privilege_name'];
			
		}
		
		return $privilegesData;
		
	}
	
}